<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div>
            <!-- 最终显示的一定是最后一个过滤器返回的结果 -->
            <!-- 多个过滤器的顺序：从左往右依次调用，所以这里先调用sing，再调用dance，再调用rap，最后调用basketball -->
            {{ hobby | sing | dance | rap | basketball }}
        </div>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                hobby: '我的是兴趣：'
            },
            filters: {
                sing (val) {

                    return val + '唱'
                },

                dance (val) {
                    console.log(val)
                    return val + '，跳'
                },

                rap (val) {

                    return val + '，rap'
                },

                basketball (val) {

                    // return val + '，打篮球'
                    return 'xxxxxx'
                }
            }
        })
    </script>
</body>
</html>